/*
	This file is part of GTimer.

    GTimer is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License\.

    GTimer is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with GTimer. If not, see <http://www.gnu.org/licenses/>.
	
	Copyright 2012 Muhammad Ghareeb Sideek
	Contact: MGhareeb64@gmail.com
 */

package com.gsourcecode.utils;

import android.graphics.Color;

public class Colors {

	public static int dark(int l, int i) {
		return Color.rgb(Color.red(l) >> i, Color.green(l) >> i, Color.blue(l) >> i);
	}

	public static int dark(int i) {
		return dark(i, 2);
	}
	
	public static int bright(int l, int i) {
		return Color.rgb(Color.red(l) << i, Color.green(l) << i, Color.blue(l) >> i);
	}

	public static int bright(int i) {
		return bright(i, 2);
	}

	public static int opacity(int c, int a) {
		return Color.argb(a, Color.red(c), Color.green(c), Color.blue(c));
	}

	public static String toString(int c) {
		return String.format("%06x", c & 0xFFFFFF);
	}

}
